<?php

  function slide(){

    $arr = array(
        array("url"=>"content.html", "title"=>"云南兰坪采矿乱象:含硫酸矿渣露天堆放", "sourceurl"=>"img/s1.jpg"),
        array("url"=>"content.html", "title"=>"慢下来 一起聆听历史最悠久的汉族古乐", "sourceurl"=>"img/s2.jpg"),
        array("url"=>"content.html", "title"=>"丽江“女游客遭殴打”案今一审宣判", "sourceurl"=>"img/s3.jpg"),
        array("url"=>"content.html", "title"=>"多型明星坦克装甲车辆首度集结亮相", "sourceurl"=>"img/s4.jpg"),
    ); 
    return json_encode($arr);
  }

  function newslist(){

    $arr = array(
        array("type"=>"1", "title"=>"全国50家网络媒体参观金龙鱼粮油“透明工厂”", "url"=>"content.html", "summary"=>"", "sourceurl"=>"img/jly1.jpg", "channel"=>"商业频道", "pubdate"=>"2017-8-9 10:32:11"),
        array("type"=>"0", "title"=>"金龙鱼助力中国美食登顶纽约联合国总部", "url"=>"content.html", "summary"=>"<p>5月25日至6月2日，在纽约联合国总部相关机构和美国华盛顿特区政府的大力支持下，由中国烹饪协会、中国粮油领导品牌金龙鱼联合主办的“中国美食走进联合国，享誉美利坚”活动将在美国首都华盛顿及纽约联合国总部盛大举办。</p>", "sourceurl"=>"", "channel"=>"商业频道", "pubdate"=>"2017-8-9 10:32:11"),
        array("type"=>"1", "title"=>"走进益海嘉里粮油工业有限公司 探访“金龙鱼”的诞生", "url"=>"content.html", "summary"=>"", "sourceurl"=>"img/jly2.jpg", "channel"=>"商业频道", "pubdate"=>"2017-8-9 13:32:11"),
        array("type"=>"3", "title"=>"震后被困“孤岛”的40小时:山石不停落 无人敢合眼", "url"=>"content.html", "summary"=>"", "sourceurl"=>array("img/jzg1.jpg", "img/jzg2.jpg", "img/jzg3.jpg"), "channel"=>"时事频道", "pubdate"=>"2017-8-9 13:32:11"),
        array("type"=>"2", "title"=>"黄晓明Angelababy代言金龙鱼阳光葵花籽油", "url"=>"content.html", "summary"=>"", "sourceurl"=>"img/jly4.jpg", "channel"=>"娱乐频道", "pubdate"=>"2017-8-12 15:29:01"),
    ); 
    return json_encode($arr);
  }
  function more(){
    $arr = array(
        array("type"=>"1", "title"=>"中央气象台发布暴雨蓝色预警：南方强降雨持续 华北东北雷雨频繁", "url"=>"content.html", "summary"=>"", "sourceurl"=>"img/m1.jpg", "channel"=>"国内频道", "pubdate"=>"2017-8-15 8:12:33"),
        array("type"=>"1", "title"=>"北京首个“开放街区”建成 专家解读开放在哪", "url"=>"content.html", "summary"=>"", "sourceurl"=>"img/m2.jpg", "channel"=>"北京频道", "pubdate"=>"2017-8-15 11:34:50"),
        array("type"=>"1", "title"=>"男篮亚洲杯 | 中国队战胜卡塔尔 迎来首胜", "url"=>"content.html", "summary"=>"", "sourceurl"=>"img/m3.jpg", "channel"=>"体育频道", "pubdate"=>"2017-8-15 12:11:30"),
        array("type"=>"1", "title"=>"震惊！ 印度5天70名儿童集中死亡", "url"=>"content.html", "summary"=>"", "sourceurl"=>"img/m4.jpg", "channel"=>"国际频道", "pubdate"=>"2017-8-14 21:34:55"),
        array("type"=>"1", "title"=>"地铁也能手机支付啦！北京今日起地铁全线支持刷手机乘车", "url"=>"content.html", "summary"=>"", "sourceurl"=>"img/m5.jpg", "channel"=>"北京频道", "pubdate"=>"2017-8-14 15:13:47"),
        array("type"=>"0", "title"=>"秘鲁决定驱逐委内瑞拉驻秘鲁大使", "url"=>"content.html", "summary"=>"当地时间11日晚，秘鲁决定驱逐委内瑞拉驻秘鲁大使。随后委内瑞拉外交部发表声明表示抗议，并决定驱逐秘鲁驻委内瑞拉贸易代表作为回应。", "sourceurl"=>"", "channel"=>"国际频道", "pubdate"=>"2017-8-14 10:25:46"),
    ); 
    return json_encode($arr);    
  }

  header('Content-type: text/json');
  $act = $_GET['act'];
  if($act == 'slide')
  {
    echo slide();
  }
  elseif($act == 'newslist')
  {
    echo newslist();
  }
  elseif($act == 'more')
  {
    echo more();
  }
  else
  {
    die(json_encode(array("errno" => 10001, "errmsg" => "Unknown action")));
  }

?>
